package service;

import entity.JPAEntity;
import java.util.List;
import javax.persistence.EntityManager;
import service.exception.ObjectNotFoundException;
import valueObject.ValueObject;

/**
 *
 * @author Juan Sebastian Hernández Serrato
 */
public abstract class AbstractService<VO extends ValueObject, E extends JPAEntity> {
    abstract public void create(VO valueObject, EntityManager em);
    abstract public void update(VO valueObject, EntityManager em) throws ObjectNotFoundException;
    abstract public void delete(Object id, EntityManager em) throws ObjectNotFoundException;
    abstract public VO findById(Object id, EntityManager em) throws ObjectNotFoundException;
    abstract public List<VO> findAll(EntityManager em);
    abstract public List<VO> findRange(int begin, int end, EntityManager em);
}